//会员
import { get_member } from "@/api/member";
export default {
  namespaced: true,
  state: {
    page: 1,
    pageSize: 10,
    status: -1,
    rows: [],
    total: "",
    info: {},
  },
  mutations: {
    toggle: (state, payload) => {
      state.total = payload.total;
      state.rows = payload.rows;
    },
    changeState: (state, payload) => {
      state.status = payload;
    },
    modify: (state, payload) => {
      state.info = payload;
    },
  },
  actions: {
    getMemberList: async ({ commit, state }) => {
      const { page, pageSize } = state;
      console.log(page, pageSize);
      const data = await get_member({
        page,
        pageSize,
      });

      console.log(data);
      commit("toggle", data);
    },

    // audit: async ({
    //     state
    // }) => {
    //     const {
    //         info
    //     } = state;
    //     console.log(info, "info");
    //     const {
    //         success
    //     } = await loan_audit(info);
    //     return success;
    // },
  },
  getters: {},
};
